package org.example.account.mapper;

import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;
import org.example.entity.Account;

@Mapper
public interface AccountMapper {

    @Select("select * from t_account where id = #{id}")
    Account selectById(@Param("id") Long id);

    @Update("update t_account set money = money - #{money} where id = #{id}")
    void reduceAccountMoney(@Param("id") Long id, @Param("money") Double money);
}
